﻿using JustMetClient.Models.InfoModels;
using Azylee.Core.DataUtils.CollectionUtils;
using Azylee.Core.WindowsUtils.InfoUtils;
using System.Collections.Generic;
using System.Linq;

namespace JustMetClient.Utils.InfoUtils
{
    public static class SoftwareInfoTool
    {
        /// <summary>
        /// 获取安装软件信息
        /// </summary>
        public static List<SoftwareInfoModel> Get()
        {
            List<SoftwareInfoModel> info = new List<SoftwareInfoModel>();
            var temp = SoftwareTool.GetControlList().Where(x => x.Name != "").ToList();
            if (ListTool.HasElements(temp))
            {
                temp.ForEach(x =>
                {
                    info.Add(new SoftwareInfoModel()
                    {
                        Name = x.Name,
                        Version = x.Version,
                        //Publisher = x.Publisher,
                        //HelpLink = x.HelpLink,
                        //URLInfoAbout = x.URLInfoAbout,
                        //EstimatedSize = x.EstimatedSize,
                        //InstallDate = x.InstallDate
                    });
                });
            }
            return info;
        }
    }
}
